import request from '@/utils/request'
enum API {
  photoApi = '/laboratory/upload',
  readApi = '/laboratory/memberIntroduce',
  createApi = '/laboratory/memberInsert',
  updateApi = '/laboratory/memberUpdate',
  detailApi = '/laboratory/memberUpdateEcho',
  deleteApi = '/laboratory/memberDelete',
}
/**
 * 图片上传
 * @returns
 */
export const photoApi = () => request.post<any>(API.photoApi)

/**
 * 成员查询
 * @returns
 */
export const readApi = () => request.get<any>(API.readApi)

/**
 * 新增成员
 * @returns
 */
export const createApi = (data: Object) =>
  request.post<any>(API.createApi, data)

/**
 * 修改成员
 * @returns
 */
export const updateApi = (data: Object) =>
  request.post<any>(API.updateApi, data)

/**
 * 成员修改回显
 * @returns
 */
export const detailApi = (data: Object) =>
  request.get<any>(API.detailApi, { params: data })

/**
 * 删除成员
 * @returns
 */
export const deleteApi = (data: Object) =>
  request.post<any>(API.deleteApi + '?id=' + data['id'])
